package com.groupbuying.provider.controller;


import com.groupbuying.provider.service.StoreMainInfoService;
import com.groupbuying.provider.service.StoreShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @anthor wenguoqiang
 * @date: 2019/02/18 9:10
 * @company 够样
 * @des
 **/

@Api("门店接口")
@RestController
@RequestMapping("/sysBack/storeShop")
public class StoreShopController {

    private static Logger log = LoggerFactory.getLogger(StoreShopController.class);

    @Autowired
    private StoreShopService storeShopService;

    @Autowired
    private StoreMainInfoService storeMainInfoService;




    @ApiOperation(value = "获取商家列表", notes = "获取商家列表")
    @PostMapping("/getShopList")
    public Object getShopList(@RequestParam Map<String, Object> params) {
        return storeShopService.getShopList(params);
    }

    @ApiOperation(value = "获取门店名称", notes = "获取门店名称")
    @PostMapping("/getUuidAndShopName")
    public List<Map<String, String>> getUuidAndStoreName() {
        return storeMainInfoService.getUuidAndStoreName();
    }

    @ApiOperation(value = "小程序获取门店详情", notes = "小程序获取门店详情")
    @PostMapping("/getShopDetail")
    public Object getShopDetail(@RequestParam Map<String, Object> params) {
        return storeMainInfoService.getShopDetail(params);
    }

    @ApiOperation(value = "通过分类或者商家名称获取商家列表", notes = "通过分类获取商家列表")
    @PostMapping("/searchShopListByCategoryOrStoreName")
    public Object searchShopListByCategoryOrStoreName(@RequestParam Map<String, Object> params) {
        return storeShopService.searchShopListByCategoryOrStoreName(params);
    }

    @ApiOperation(value = "获取推荐门店", notes = "获取推荐门店")
    @PostMapping("/getRecommendStoreList")
    public Object getRecommendStoreList(@RequestParam Map<String, Object> params) {
        return storeShopService.getRecommendStoreList(params);
    }
}
